package PTA;

import java.io.*;

public class Lx02 {
    public static void main(String[] args) {
        String path = "E:"+ File.separator+"Material.txt";
        File file = new File(path);
        if(!file.exists()) {
            System.out.println("文件不存在");
            System.exit(1);
        }
        try {
            InputStream inputStream = new FileInputStream(file);
            byte[] b = new byte[(int) file.length()];
            int len = inputStream.read(b);
            String  s1 = new String(b);
            String s2 = s1.replaceAll("Neo4java","Neo4j");
            inputStream.close();
            OutputStream outputStream = new FileOutputStream(file);
            outputStream.write(s2.getBytes());
            outputStream.close();
        }catch (IOException e) {
            e.printStackTrace();
        }
    }
}

